<template>
  <div>
    <h5>接收的Id：{{ $route.query.id }}</h5>
    <h5>接收的Title：{{ $route.query.title }}</h5>
  </div>
</template>
<script>
export default {
  name: "MessageDetils",

  //进入守卫：通过路由规则，进入该组件时被调用
  beforeRouteEnter(to, from, next) {
    console.log("组件内守卫-beforeRouteEnter", to, from);
    next();
  },
  //离开守卫：通过路由规则，离开该组件时被调用
  beforeRouteLeave(to, from, next) {
    console.log("组件内守卫-beforeRouteLeave", to, from);
    next();
  },
};
</script>
